// src/main/java/org/example/backend/dto/UserQueryDto.java
package org.example.backend.dto;

import lombok.Getter;
import org.springframework.data.domain.Pageable;

public class UserQueryDto {
    // Getters and Setters
    @Getter
    private String username;
    @Getter
    private String role;
    @Getter
    private Integer status;
    private Integer page = 0;
    private Integer size = 10;
    @Getter
    private Pageable pageable;

    public void setUsername(String username) {
        this.username = username;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getPage() {
        return page != null ? page : 0; // 添加空值检查
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getSize() {
        return size != null ? size : 10; // 添加空值检查
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public void setPageable(Pageable pageable) {
        this.pageable = pageable;
    }
}
